import axios from 'axios'

axios.defaults.baseURL = 'https://api.example.com'

axios.interceptors.request.use(function (config) {

  console.log(config)

  config.params = {
    ...config.params,
    appkey: 'app-key'
  }

  return config

}, function (error) {

  // 对请求错误做些什么
  return Promise.reject(error)
})

export default axios
